﻿using DevExpress.XtraGrid.Demos.util;
using DiaoPaiDaYin;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.下单MTO.Service;
using DXApplicationTangche.UC.客户CRM.Service;
using mendian;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.客户管理
{
    public partial class Frm新建客户量体 : DevExpress.XtraEditors.XtraForm
    {
        private int fitCountId;

        public Frm新建客户量体(int fitCountId)
        {
            InitializeComponent();
            this.fitCountId = fitCountId;
        }

        public Frm新建客户量体(int fitCountId,List<CustomerInformation> customerInformations)
        {
            InitializeComponent();
            this.fitCountId = fitCountId;
            this.initialText(customerInformations);
        }
        private void initialText(List<CustomerInformation> customerInformations)
        {
            try
            {
                foreach (CustomerInformation item in customerInformations)
                {
                    if (!String.IsNullOrEmpty(item.value))
                    {
                        if ("身高".Equals(item.information))
                        {
                            this.shengao.Text = item.value;
                        }
                        else if ("体重".Equals(item.information))
                        {
                            this.tizhong.Text = item.value;
                        }
                        //   
                        else if ("肩型".Equals(item.information))
                        {
                            this.jianxing.Text = item.value;
                        }
                        else if ("体型".Equals(item.information))
                        {
                            this.tixing.Text = item.value;
                        }
                        else if ("喜好".Equals(item.information))
                        {
                            this.xihao.Text = item.value;
                        }
                        else if ("胸型".Equals(item.information))
                        {
                            this.xiongxing.Text = item.value;
                        }
                        // 
                        else if ("领围".Equals(item.information))
                        {
                            this.lingwei.Text = item.value;
                        }
                        else if ("胸围".Equals(item.information))
                        {
                            this.xiongwei.Text = item.value;
                        }
                        else if ("臀围".Equals(item.information))
                        {
                            this.tunwei.Text = item.value;
                        }
                        else if ("身长".Equals(item.information))
                        {
                            this.shenchang.Text = item.value;
                        }
                        else if ("肩宽".Equals(item.information))
                        {
                            this.jiankuan.Text = item.value;
                        }
                        else if ("臂长".Equals(item.information))
                        {
                            this.xiuchang.Text = item.value;
                        }
                        else if ("臂根围".Equals(item.information))
                        {
                            this.shangbixiufei.Text = item.value;
                        }
                        else if ("腕围".Equals(item.information))
                        {
                            this.wanwei.Text = item.value;
                        }
                        else if ("腰围".Equals(item.information))
                        {
                            this.yaowei.Text = item.value;
                        }
                    }
                }
            }
            catch { }
        }
        
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Dictionary<String, String> itemValueAndFitValueMap = new Dictionary<string, string>();
            //身高
            if (!String.IsNullOrWhiteSpace(this.shengao.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_09", this.shengao.Text.Trim());
            }
            //体重
            if (!String.IsNullOrWhiteSpace(this.tizhong.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_10", this.tizhong.Text.Trim());
            }
            //肩宽CODE
            if (!String.IsNullOrWhiteSpace(this.jiankuan.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_05", this.jiankuan.Text.Trim());
            }
            //胸围CODE
            if (!String.IsNullOrWhiteSpace(this.xiongwei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_02", this.xiongwei.Text.Trim());
            }
            //腰围CODE
            if (!String.IsNullOrWhiteSpace(this.yaowei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_12", this.yaowei.Text.Trim());
            }
            //臀围CODE
            if (!String.IsNullOrWhiteSpace(this.tunwei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_03", this.tunwei.Text.Trim());
            }
            //身长CODE
            if (!String.IsNullOrWhiteSpace(this.shenchang.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_04", this.shenchang.Text.Trim());
            }
            //领围CODE
            if (!String.IsNullOrWhiteSpace(this.lingwei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_01", this.lingwei.Text.Trim());
            }
            //腕围CODE
            if (!String.IsNullOrWhiteSpace(this.wanwei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_08", this.wanwei.Text.Trim());
            }
            //袖长CODE
            if (!String.IsNullOrWhiteSpace(this.xiuchang.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_06", this.xiuchang.Text.Trim());
            }
            //上臂袖肥CODE
            if (!String.IsNullOrWhiteSpace(this.shangbixiufei.Text))
            {
                itemValueAndFitValueMap.Add("FITMT_ITEM_07", this.shangbixiufei.Text.Trim());
            }
            //体型CODE
            if (!String.IsNullOrWhiteSpace(this.tixing.Text))
            {
                switch (this.tixing.Text)
                {
                    case "正常":
                        itemValueAndFitValueMap.Add("FITMT_CODE_03", "CD03_07");
                        break;
                    case "中肚":
                        itemValueAndFitValueMap.Add("FITMT_CODE_03", "CD03_08");
                        break;
                    case "大肚":
                        itemValueAndFitValueMap.Add("FITMT_CODE_03", "CD03_09");
                        break;
                    case "后腰空":
                        itemValueAndFitValueMap.Add("FITMT_CODE_03", "CD03_10");
                        break;
                }
            }
            //喜好CODE
            if (!String.IsNullOrWhiteSpace(this.xihao.Text))
            {
                switch (this.xihao.Text)
                {
                    case "标准":
                        itemValueAndFitValueMap.Add("FITMT_CODE_08", "CD08_01");
                        break;
                    case "超修":
                        itemValueAndFitValueMap.Add("FITMT_CODE_08", "CD08_02");
                        break;
                    case "宽松":
                        itemValueAndFitValueMap.Add("FITMT_CODE_08", "CD08_03");
                        break;
                }
            }
            //肩型
            if (!String.IsNullOrWhiteSpace(this.jianxing.Text))
            {
                switch (this.jianxing.Text)
                {
                    case "平肩":
                        itemValueAndFitValueMap.Add("FITMT_CODE_01", "1");
                        break;
                    case "溜肩":
                        itemValueAndFitValueMap.Add("FITMT_CODE_01", "2");
                        break;
                    case "正常":
                        itemValueAndFitValueMap.Add("FITMT_CODE_01", "3");
                        break;
                    case "冲肩":
                        itemValueAndFitValueMap.Add("FITMT_CODE_01", "4");
                        break;
                }
            }
            //胸型
            if (!String.IsNullOrWhiteSpace(this.xiongxing.Text))
            {
                switch (this.xiongxing.Text)
                {
                    case "正常":
                        itemValueAndFitValueMap.Add("FITMT_CODE_09", "CD09_01");
                        break;
                    case "驼背":
                        itemValueAndFitValueMap.Add("FITMT_CODE_09", "CD09_02");
                        break;
                    case "挺胸":
                        itemValueAndFitValueMap.Add("FITMT_CODE_09", "CD09_03");
                        break;
                    case "丰满胸":
                        itemValueAndFitValueMap.Add("FITMT_CODE_09", "CD09_04");
                        break;
                }
            }
            FunctionHelper.JsonSerialization(itemValueAndFitValueMap);
            try
            {
                if (itemValueAndFitValueMap.Count <= 0)
                {
                    return;
                }
                CRM客户Service.modifyCustomerFit(fitCountId, itemValueAndFitValueMap);
                MessageBox.Show("保存成功");
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败");
                return;
            }
            #region 原sql文修改
            //            this.customerZero();
            //            SQLmtm.ExecuteSql("DELETE FROM a_customer_fit_r WHERE FIT_COUNT_ID='" + this.customer_countid + "'");
            //            //身高
            //            int i3 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //                new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_09", "0", this.shengao.Text, customer_countid.ToString() });
            //            if (i3 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //体重
            //            int i4 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //                    new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_10", "0", this.tizhong.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i4 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //肩宽CODE
            //            int i5 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_05", "0", this.jiankuan.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i5 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //胸围CODE
            //            int i6 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_02", "0", this.xiongwei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i6 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //腰围CODE
            //            int i7 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_12", "0", this.yaowei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i7 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //臀围CODE
            //            int i8 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_03", "0", this.tunwei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i8 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //身长CODE
            //            int i9 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_04", "0", this.shenchang.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i9 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //领围CODE
            //            int i10 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_01", "0", this.lingwei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i10 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //腕围CODE
            //            int i11 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_08", "0", this.wanwei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i11 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //袖长CODE
            //            int i12 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_06", "0", this.xiuchang.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i12 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //上臂袖肥CODE
            //            int i13 = SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //        new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_ITEM_07", "0", this.shangbixiufei.Text, customer_countid.ToString() });
            //            //cUSTOMER_FIT_ID++;
            //            if (i13 != 1)
            //            {
            //                MessageBox.Show("保存失败");
            //            }
            //            //体型CODE
            //            switch (this.tixing.Text)
            //            {
            //                case "正常":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_03", "0", "CD03_07", customer_countid.ToString() }); break;
            //                case "中肚":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_03", "0", "CD03_08", customer_countid.ToString() }); break;
            //                case "大肚":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_03", "0", "CD03_09", customer_countid.ToString() }); break;
            //                case "后腰空":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_03", "0", "CD03_10", customer_countid.ToString() }); break;
            //            }
            //            //cUSTOMER_FIT_ID++;
            //            //喜好CODE
            //            switch (this.xihao.Text)
            //            {
            //                case "标准":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_08", "0", "CD08_01", customer_countid.ToString() }); break;
            //                case "超修":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_08", "0", "CD08_02", customer_countid.ToString() }); break;
            //                case "宽松":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_08", "0", "CD08_03", customer_countid.ToString() }); break;
            //            }
            //            //cUSTOMER_FIT_ID++;
            //            //肩型
            //            switch (this.jianxing.Text)
            //            {
            //                case "平肩":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //            new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_01", "0", "1", customer_countid.ToString() }); break;
            //                case "溜肩":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //            new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_01", "0", "2", customer_countid.ToString() }); break;
            //                case "正常":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //            new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_01", "0", "3", customer_countid.ToString() }); break;
            //                case "冲肩":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //            new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_01", "0", "4", customer_countid.ToString() }); break;
            //            }
            //            //胸型
            //            switch (this.xiongxing.Text)
            //            {
            //                case "正常":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_09", "0", "CD09_01", customer_countid.ToString() }); break;
            //                case "驼背":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_09", "0", "CD09_02", customer_countid.ToString() }); break;
            //                case "挺胸":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_09", "0", "CD09_03", customer_countid.ToString() }); break;
            //                case "丰满胸":
            //                    SQLmtm.DoInsert("a_customer_fit_r", new string[] { "CUSTOMER_ID", "STYLE_CATEGORY_CD", "ITEM_CD", "ITEM_VALUE", "DELETE_FLAG", "FIT_VALUE", "FIT_COUNT_ID" },
            //new string[] { cUSTOMER_ID.ToString(), "STYLE_CATEGORY-SHIRT", "SHIRT_FITMT004", "FITMT_CODE_09", "0", "CD09_04", customer_countid.ToString() }); break;

            //            }
            //            String listFitData = null;
            //            try
            //            {
            //                DataTable dt = SQLmtm.GetDataTable("SELECT CUSTOMER_ID,ITEM_CD,ITEM_VALUE,FIT_VALUE FROM `a_customer_fit_r` WHERE FIT_COUNT_ID='" + customer_countid.ToString() + "'");
            //                foreach (DataRow dr in dt.Rows)
            //                {
            //                    listFitData = listFitData + dr["ITEM_CD"].ToString() + "-" + dr["ITEM_VALUE"].ToString() + ":" + dr["FIT_VALUE"] + ",";
            //                }
            //            }
            //            catch
            //            {
            //                MessageBox.Show("保存失败");
            //                return;
            //            }
            //            FitValueCalculate fvc = new FitValueCalculate(customer_countid.ToString(), listFitData);
            //            String fjsondata = Newtonsoft.Json.JsonConvert.SerializeObject(fvc);
            //            RestCall.PostHttp(URL.接口url + "/size/updateCalculate", fjsondata);
            //            MessageBox.Show("保存成功");
            //            this.Close();
            #endregion
        }

    }
}
